import request from '@/utils/request'

/**
 * 
 * @returns 获取项目列表
 */
export function getProjectList(query) {
    return request({
        url: '/project/list/list',
        method: 'get',
        params: query
    })
}


/**
 * 
 * @returns 创建项目
 */
export function addProject(data) {
    return request({
        url: '/project/list/add',
        method: 'post',
        data: data
    })
}

/**
 * 
 * @returns 驳回项目
 */
export function rejectProject(data) {
    return request({
        url: '/project/list/rejectProject',
        method: 'post',
        data: data
    })
}



/**
 * 
 * @returns 保存草稿
 */
export function draftProject(data) {
    return request({
        url: '/project/list/draft',
        method: 'post',
        data: data
    })
}


/**
 * 
 * @returns 修改项目
 */
export function modifyProject(data) {
    return request({
        url: '/project/list/modify',
        method: 'post',
        data: data
    })
}




/**
 * 查询详情
 */
export function getDetail(id) {
    return request({
        url: '/project/list/detail?id='+id,
        method: 'get' 
    })
}
 
/**
 * 删除项目
 * @param {*} data 
 * @returns 
 */
export function delProject(data) {
    return request({
        url: '/project/list/del',
        method: 'post',
        data: data
    })
}

/**
 * 项目中止
 * @param {*} data 
 * @returns 
 */
export function stopProject(data) {
    return request({
        url: '/project/list/stop',
        method: 'post',
        data: data
    })
}

/**
 * 重启项目
 * @param {*} data 
 * @returns 
 */
export function restartProject(data) {
    return request({
        url: '/project/list/restart',
        method: 'post',
        data: data
    })
}


/**
 * 项目里程碑
 */
export function getMilestone(id) {
    return request({
        url: '/project/list/queryMilestone?id='+id,
        method: 'get' 
    })
}



/**
 * 项目进度
 */
export function queryProgress(id) {
    return request({
        url: '/project/list/queryProgress?id='+id,
        method: 'get' 
    })
}


/**
 * 根据项目经理项目汇总
 */
export function totalProjectForUser(userFlag) {
    return request({
        url: '/project/list/totalProjectForUser?userFlag='+userFlag,
        method: 'get' 
    })
}

/**
 * 查询没有进入BUG LIST的项目列表
 * @param {*} data 
 * @returns 
 */

export function queryProjectListNoBug(data) {
    return request({
        url: '/project/list/queryProjectListNoBug',
        method: 'get',
        params: data
    })
}

/**
 * 项目变更 
 * @param {} data 
 * @returns 
 */
export function modifyProjectTime(data) {
    return request({
        url: '/project/list/modifyProject',
        method: 'post',
        data: data
    })
}


/**
 * 项目经理变更 
 * @param {} data 
 * @returns 
 */
export function modifyProjectManager(data) {
    return request({
        url: '/project/list/modifyProjectManager',
        method: 'post',
        data: data
    })
}

/**
 * 查询项目变更记录 
 * @param {} data 
 * @returns 
 */
export function queryProjectModifyRecord(param) {
    return request({
        url: '/project/list/queryProjectModifyRecord',
        method: 'get',
        params:param 
    })
}


/**
 * 项目变更流程修改 
 * @param {} data 
 * @returns 
 */
export function updateModifyProjectTime(data) {
    return request({
        url: '/project/list/updateModifyProject',
        method: 'post',
        data: data
    })
}

/**
 * 流程历史变更数据 
 * @param {} data 
 * @returns 
 */
export function getHistoryModifyProject(data) {
    return request({
        url: '/project/list/queryProjectModifyRecordDetail',
        method: 'post',
        data: data
    })
}

/**
 * 添加项目成员 
 * @param {} data 
 * @returns 
 */
export function addProjectMember(data) {
    return request({
        url: '/project/list/addProjectMember',
        method: 'post',
        data: data
    })
}

/**
 * 替换项目成员 
 * @param {} data 
 * @returns 
 */
export function replaceProjectMember(data) {
    return request({
        url: '/project/list/replaceProjectMember',
        method: 'post',
        data: data
    })
}

/**
 * 查询项目操作日志 
 * @param {} projectListId 
 * @returns 
 */
export function queryProjectOperLog(projectListId) {
    return request({
        url: '/project/list/log?projectListId='+projectListId,
        method: 'get'
    })
}











